Florian Müllner [Wed, 9 Feb 2022 14:22:42 +0000 (15:22 +0100)]
st: Use g_object_notify_by_pspec() where possible
It's slightly more efficient not having to do property lookups. While
that is unlikely to be a concern for the properties in question, it's
still good practice and makes the code base a bit more consistent.
Carlos Garnacho [Wed, 9 Feb 2022 14:32:56 +0000 (15:32 +0100)]
popupMenu: Avoid intermediate focus changes on menu switch
Currently when switching from a popup menu to another in the same
manager, we first show the new menu, then hide the old menu and
remove its grab, then create a new grab for the just shown menu.
This briefly ungrabbed moment will still trigger keyboard focus
changes, that might have other visible effects. In order to fix
this, change the grabbing order so first the new grab is created
then the old one is dismissed. This ensures focus moves from the
old menu to the new menu without gaps in between.
Since a grab is tied to an active menu, but close/grab are now
slightly decoupled, also ensure closing a menu only tears down its
own grab. This is necessary for correct accounting while doing the
grab shuffling.
Bastien Nocera [Tue, 18 Jan 2022 10:14:47 +0000 (11:14 +0100)]
status/bluetooth: Fix wedged state
Fix a state where toggling the main Bluetooth switch in the header will
always show the "Bluetooth Off" menu header with "Turn Off" as the only
option.
To reproduce, with Bluetooth enabled and working, run
"hciconfig hci0 down" as root, and check the status menu.
See gnome-bluetooth!102 and gnome-control-center!1148
dbusServices/extensions: Give extensions access to the prefs window
The current preference API - buildPrefsWidget() - predates client-side
decorations. While extension authors have been finding ways around
the limitation of not having access to the window/titlebar, the change
to the new Adwaita API seems like a good time for an updated API that
officially provides that access (as far as allowed by libadwaita).
dbusServides/extensions: Use Adw.PreferencesWindow
Adapt the new GNOME platform API for the upcoming 42. This makes
sure that we get the latest version of the stylesheet, as well as
support for the new dark mode.
Using the dedicated preference API also gives extensions with more
complex preferences an easier and standardized way for implementing
multi-page preferences.
dbusServices/extensions: Split error page from window
The error UI comprises the bits that are actually custom. Splitting them
out from the off-the-shelf window makes it easier to replace the dialog
with libadwaita's dedicated preference window.
Florian Müllner [Thu, 3 Feb 2022 00:57:46 +0000 (01:57 +0100)]
dbusServices: Allow replacement
The REPLACE flag we currently pass is useless, as replacing the service
is disallowed when not started with the ALLOW_REPLACEMENT flag.
Fix this by adopting a more standard pattern where replacement is always
allowed, but only actually requested when `--replace` is passed on the
command line.
Florian Müllner [Thu, 3 Feb 2022 01:34:37 +0000 (02:34 +0100)]
dbusServices/notifications: Disallow acting on "foreign" IDs
The Notify() and CloseNotification() methods act on a notification,
identified by the passed ID. Just like it makes sense to only emit
notification signals to the original sender, those methods should
be restricted to the notification owner.
All fd.o Notifications signals are emitted for a particular notification,
so debugging aside, only the owner of said notification has a legitimate
reason to act on it.
So far we (and other implementations like the old notification-daemon)
have relied on the client-side to properly filter the signals (like
libnotify), but at least the QT implementation is known to not do
that.
Enforce correct client behavior by only emitting the signal to the
original sender.
Sam Hewitt [Wed, 2 Feb 2022 18:17:42 +0000 (14:47 -0330)]
theme: Papercut fixes from 42 refresh
- simplified drawing functions
- refactored button drawing
- dropped arrow from all popovers
- cleaned out some legacy css
- fixed many of the issues in #4969
Sam Hewitt [Mon, 31 Jan 2022 15:10:58 +0000 (11:40 -0330)]
theme: Remove icon resources from theme
- move all icons to the icons directory
- rename some icons to be more meaningful
- put all icons on a resource sheet
- update references to icon name changes
- deprecate icons for those in standard set
Milan Crha [Wed, 2 Feb 2022 14:34:03 +0000 (15:34 +0100)]
calendar-server: Read timezone from the calendar, not its timezone cache
The calendar's timezone cache holds only timezones already received
or added to the calendar, thus when asking it for a timezone for "the first
time", it returns NULL and a wrong timezone is used instead.
The get_timezone() does not do any I/O when the timezone is already cached
on the client side, thus it's fine to use it.
This could exhibit with non-recurring events, which use custom time zones,
in which case the event is shown in a wrong time.
CSS and JS adapted from the Overview window close buttons, but with some
style tweaks requested by the designers.
Since the screenshot UI is long-lived (it's created once at startup,
rather than every time it's opened), we need to refresh the close button
position, as it can change at runtime. Subscribing to preference changes
seems to be skipped for bindings generation in Mutter, but simply
refreshing upon opening the UI should do the job.
Since the screenshot UI cannot open in GDM or on the lock screen, it
seems that simply closing it on any session mode update is sufficient,
without adding extra variables.
Carlos Garnacho [Wed, 2 Feb 2022 16:07:42 +0000 (17:07 +0100)]
dnd: Drop captured event handler
This was here exclusively to silence out events from other pointing
devices in the stage. Since ClutterGrab being used now is global to
all devices and events are coerced to an invisible actor, there is
no need to explicitly do this.
Also, this event handler was set on the stage, while the grab happened
on a child, so it was fairly uneffective already.
Carlos Garnacho [Wed, 2 Feb 2022 16:05:32 +0000 (17:05 +0100)]
dnd: Make event handler actor reactive
Even though we coerce events on it through a grab, it does require
to be reactive to be considered a keyboard focus. Make it reactive
so it can handle key events again.
Carlos Garnacho [Tue, 1 Feb 2022 13:33:03 +0000 (14:33 +0100)]
popupMenu: Ensure to let focus manager handle key events
Since the grab no longer lets events bubble up to the stage unstopped,
we should be forwarding the key events that bubbled up to the dialog
to maybe cycle focus.
Fixes broken keyboard navigation in several context menus around the
shell, other than the panel ones.
Carlos Garnacho [Tue, 1 Feb 2022 13:31:37 +0000 (14:31 +0100)]
modalDialog: Ensure to let focus manager handle key events
Since the grab no longer lets events bubble up to the stage unstopped,
we should be forwarding the key events that bubbled up to the dialog
to maybe cycle focus.
Fixes focus cycling on keyboard navigation inside dialogs.
Carlos Garnacho [Tue, 1 Feb 2022 13:12:17 +0000 (14:12 +0100)]
endSessionDialog: Connect to events in the dialog itself
Connecting to stage events won't work from a modal dialog, since the
grab will take events from the portions of the actor hierarchy above
the grabbing actor.
Connect to events from the dialog itself, so that the end session
dialog can again show the "boot options" easter egg.
Carlos Garnacho [Mon, 31 Jan 2022 11:16:47 +0000 (12:16 +0100)]
grabHelper: Fix handling of events within the grabbed actor
Commit d92b71d2b2 went overeager in the removal of the additional
actors that were allowed to handle events (since the new grab
infrastructure makes them unable to see events in the first place),
and removed an early return in the captured event handler meant to
let events go through in those cases.
Since the grabbing actor was also part of this group, this was also
the code path where child actors of the grabbing actor could handle
events. Removing these made the captured event handler eat most
events meant for children. Add this check back, specifically for the
grabbing actor.
While at it, explicitly check (and propagate) crossing events,
since these are now enforced to be propagated (and warned about) in
Mutter.
kyte [Mon, 31 Jan 2022 21:59:49 +0000 (03:29 +0530)]
swipeTracker: Ignore Meta key while workspace scroll gesture is in progress
Workspace transition stopped midway when the Meta key
was released while the two-finger scroll gesture was
in progress. This commit ignores the Meta key once
the gesture has been confirmed and is in motion.
status/remote-access: Add menu for stopping screencasts
This is specifically for stopping the screenshot UI screencasts for now.
It's possible to stop arbitrary screen recording handles, however due to
an issue with pipewiresrc, this method cannot currently work for cleanly
stopping Shell's own screen recordings. Hence the best we can do is to
handle just the screenshot UI screencasts to let them stop cleanly.
screenshot: Assign names to several CSS expressions
This commit replaces a few of the screenshot UI CSS expressions with
named variables.
The shot-cast margin is not defined, but rather set to the value it ends
up equal to, given the panel padding and the capture button's
sizes + position, which would be a bit awkward to compute here. It ends
up slightly larger than the general panel padding due to the capture
button being larger than other elements, and due to having to
center-align the shot-cast container to the capture button.
The shot-cast container border radius is defined as 12px, then the panel
border radius is computed from the shot-cast border radius + margin,
then the type button border radius is computed from panel
border radius - padding.
Currently does nothing. When we're in screencast mode, we hide the
screenshot preview because screencast doesn't start until the capture
button is pressed.
The window selection is currently left as is, but it should probably be
changed to something closer to a real overview, showing windows in
real-time.
Carlos Garnacho [Fri, 19 Nov 2021 12:28:48 +0000 (13:28 +0100)]
appDisplay: Drop grabHelper.addActor() call
This no longer does what it advertises to do, the folder dialog
is already modal and handles clicks outside to dismiss the dialog,
so this does not seem necessary either.